/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.asistente.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Wizard
 */
@Entity
@Table(name = "hd_clasificacion_baja")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HdClasificacionBaja.findAll", query = "SELECT h FROM HdClasificacionBaja h"),
    @NamedQuery(name = "HdClasificacionBaja.findByCodNivel3", query = "SELECT h FROM HdClasificacionBaja h WHERE h.codNivel3 = :codNivel3"),
    @NamedQuery(name = "HdClasificacionBaja.findByDesNivel3", query = "SELECT h FROM HdClasificacionBaja h WHERE h.desNivel3 = :desNivel3"),
    @NamedQuery(name = "HdClasificacionBaja.findByIndEstadoNivel3", query = "SELECT h FROM HdClasificacionBaja h WHERE h.indEstadoNivel3 = :indEstadoNivel3")})
public class HdClasificacionBaja implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "COD_NIVEL3")
    private Integer codNivel3;
    @Size(max = 50)
    @Column(name = "DES_NIVEL3")
    private String desNivel3;
    @Column(name = "IND_ESTADO_NIVEL3")
    private Character indEstadoNivel3;
    @OneToMany(mappedBy = "codNivel3", fetch = FetchType.LAZY)
    private Collection<HdTickets> hdTicketsCollection;
    @JoinColumn(name = "COD_NIVEL2", referencedColumnName = "COD_NIVEL2")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private HdClasificacionMedia codNivel2;

    public HdClasificacionBaja() {
    }

    public HdClasificacionBaja(Integer codNivel3) {
        this.codNivel3 = codNivel3;
    }

    public Integer getCodNivel3() {
        return codNivel3;
    }

    public void setCodNivel3(Integer codNivel3) {
        this.codNivel3 = codNivel3;
    }

    public String getDesNivel3() {
        return desNivel3;
    }

    public void setDesNivel3(String desNivel3) {
        this.desNivel3 = desNivel3;
    }

    public Character getIndEstadoNivel3() {
        return indEstadoNivel3;
    }

    public void setIndEstadoNivel3(Character indEstadoNivel3) {
        this.indEstadoNivel3 = indEstadoNivel3;
    }

    @XmlTransient
    public Collection<HdTickets> getHdTicketsCollection() {
        return hdTicketsCollection;
    }

    public void setHdTicketsCollection(Collection<HdTickets> hdTicketsCollection) {
        this.hdTicketsCollection = hdTicketsCollection;
    }

    public HdClasificacionMedia getCodNivel2() {
        return codNivel2;
    }

    public void setCodNivel2(HdClasificacionMedia codNivel2) {
        this.codNivel2 = codNivel2;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codNivel3 != null ? codNivel3.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HdClasificacionBaja)) {
            return false;
        }
        HdClasificacionBaja other = (HdClasificacionBaja) object;
        if ((this.codNivel3 == null && other.codNivel3 != null) || (this.codNivel3 != null && !this.codNivel3.equals(other.codNivel3))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.asistente.DAO.HdClasificacionBaja[ codNivel3=" + codNivel3 + " ]";
    }
    
}
